

public class Conv_SistCoord {
	double v[] = new double[3];
	public double[] Geod_Pl(int a, int f, int alt, double lat, double lng){
		double N = a/Math.sqrt(1-((f/2)/a)*((f/2)/a)*Math.sin(lat)*Math.sin(lng));
		double x = (N+alt)*Math.cos(lat)*Math.cos(lng);
		double y = (N+alt)*Math.cos(lat)*Math.sin(lng);
		double z = (N*(1-((f/2)/a)*((f/2)/a))+alt)*Math.sin(lat);
		v[0]=x;
		v[1]=y;
		v[2]=z;

		return v;
	}
	public void Pl_Geod(double x, double y, double z, double e, double a, double b){
		double tg_u = (z*a)/(Math.sqrt(x*x + y*y)*b);
		double u = arctg(tg_u);
		double tg_lat = (z + e*e*b*Math.sin(u)*Math.sin(u)*Math.sin(u))/(Math.sqrt(x*x + y*y) - e*e*a*Math.cos(u)*Math.cos(u)*Math.cos(u));
		double lat =  arctg(tg_lat);
		double lng = arctg(x/y);
		double alt = Math.sqrt(x*x + y*y)/Math.cos(lat) - a/(1 - e*e*Math.sin(lat)*Math.sin(lat));
	}
	public double arctg(double x){
		return x - x*x*x/3 + x*x*x*x*x/5 - x*x*x*x*x*x*x/7;
	}
}